#ifndef __DLCD_H__
#define __DLCD_H__


#define RGB_RED         0x00F8
#define RGB_BLACK       0x0000
#define RGB_WHITE       0xffff
#define RGB_BLUE        0x1F00
#define RGB_GREEN       0xE007
#define RGB_YELLOW      (RGB_GREEN|RGB_RED)
#define RGB_MAGENTA     (RGB_BLUE|RGB_RED)
#define RGB_LIGHTBLUE   (RGB_BLUE|RGB_GREEN)
#define RGB_ORANGE      (RGB_RED | 0xE001)       // green/2 + red
#define RGB_PINK        (RGB_MAGENTA | 0xE001)   // green/2 + magenta

// Characters Infos
#define CHAR_WIDTH            7
#define CHAR_HEIGHT           14


enum LcdCommandTypeEnum
    {
    LCD_STRING = 0,
    } LcdCommandTypeEnum;

typedef struct LcdString
    {
    u8 x;
    u8 y;
    u8* str;
    u8 len;
    } LcdString;

typedef struct LcdCommand
    {
    enum LcdCommandTypeEnum type;
    u8 x;
    u8 y;
    void* payload;
    } LcdCommand;

void LCD_Configuration( void );
void LCD_GetResource( void );
void LCD_ReleaseResource( void );

void LCD_SetTextColor( u16 textColor, u16 backColor );
void LCD_GetTextColor( u16* textColor, u16* backColor );

void LCD_PutChar( u8 x, u8 y, u8 chr );
void LCD_PutString( u8 x, u8 y, const u8 * str, u8 len );

void LCD_DrawFilledRect( u8 x, u8 y, u8 width, u8 height, u16 color );
void LCD_DrawRect( u8 x, u8 y, u8 width, u8 height, u16 color );
void LCD_ReadRect( u16 x, u16 y, u16 width, u16 height, u8* bmp );

void LCD_DrawPixel( u8 x, u8 y, u16 Color );
u16 LCD_GetPixel( u8 x, u8 y );

#endif // __DLCD_H__